type BuildArr<Length extends number, Arr extends unknown[] = []> = Arr['length'] extends Length
    ? Arr : BuildArr<Length, [...Arr, unknown]>

type MinusOne<T extends number> = BuildArr<T> extends [unknown, ...infer R]
    ? R['length'] : never

// 超过1000溢出